//
//  DFActionSheet.m
//  换换圈
//
//  Created by 艾柯斯 on 14-12-9.
//  Copyright (c) 2014年 艾柯斯. All rights reserved.
//

#import "DFActionSheet.h"

typedef void (^ClickedButtonBlock)(NSInteger buttonIndex);

@interface DFActionSheet() <UIActionSheetDelegate> {
    ClickedButtonBlock _clickedButton;
}

@end



@implementation DFActionSheet


-(void)showInView:(UIView *)view clickedButton:(void (^)(NSInteger))clickedButton {
    self.delegate = self;
    _clickedButton = clickedButton;
    [self showInView:view];
}



-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
    if(_clickedButton) {
        _clickedButton(buttonIndex);
    }
}




@end
